using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Siderys.Blog.CustomField;

namespace Siderys.Blog.CustomField
{
    public class UniqueFieldType: Microsoft.SharePoint.SPFieldText
    {
        public UniqueFieldType(SPFieldCollection pFields, string pFieldName):base(pFields, pFieldName)
        {
        }

        public UniqueFieldType(SPFieldCollection pFields, string pFieldName, string pDisplayName):base(pFields,pFieldName, pDisplayName)
        {
        }

        public override string GetValidatedString(object value)
        {
            return value.ToString();
        }
        public override Microsoft.SharePoint.WebControls.BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl lUniqueColumn = new UniqueFieldColumn(this.Required, this.InternalName, SPContext.Current.List);
                lUniqueColumn.FieldName = InternalName;
                return lUniqueColumn;
            }
        }
    }
}
